package com.wx.lambda;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.IntPredicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * @description:
 * @author: wangxun
 * @createDate: 2021/12/29
 * @version: 1.0
 */
public class LambdaTest {
    public static void main(String[] args) {

        /** reduce 最大值*/
        Stream<Integer> stream = Stream.of(1,2,3,54,6,2324,11,11);

        Integer max = stream.reduce(0, (tempMax, next) ->
            tempMax = next > tempMax ? next : tempMax
        );
        System.out.println(max);

        IntStream stream1 = Arrays.stream(new int[]{1, 2, 3, 4, 5, 1, 333, 1232});
        stream1.forEach(System.out::println);


    }
}
